import request from 'utils/request'

export const getUserInfo = (params) => request.get('/p/user/info', params) //账户设置

export const editLoginPwd = (params) => request.post('/p/user/updatePassword', params) //修改登录密码

export const editPhone = (params) => request.post('/p/updateMobile', params) //修改手机号码

export const editNickname = (params) => request.post('/p/user/updateNickName', params) //修改昵称

export const editPayPwd = (params) => request.post('/p/updatePaymentPassword', params) //修改支付密码

export const editPortrait = (params) => request.post('/p/user/savePhoto', params) //修改头像

export const editName = (params) => request.post('/p/user/updateRealName', params) //修改姓名

export const editSex = (params) => request.post('/p/user/updateSex', params) //修改性别

export const editBirthday = (params) => request.post('/p/user/updateBirthDate', params) //修改生日

export const uploadFile = (params) => request.post('/p/uploadPhoto', params) //上传图片

export const checkPhone = (params) => request.post('/p/validateUserMobile', params) //校验原手机号

// 校验验证码
export const verifyPhoneCode = (params) => request.get('/verifyPhoneCode', params)

// 判断手机号码是否存在
export const isPhoneExist = (params) => request.post('/isPhoneExist', params)

//更新手机号
export const updateMobile = (params) => request.post('/p/user/updateMobile', params)

// 账号与安全首页
export const accountSecurityIndex = (params) => request.post('/p/accountSecurity/index', params, {})

// 获取用户资料字段设置
export const materialFieldSetting = (params) => request.get('/p/user/materialFieldSetting', params)

// 保存用户信息
export const userInfoSave = (params) => request.post('/p/user/info/save', params, {})

// 微信浏览器退出
export const wxthirdLogout = (type, channel) => request.post(`/p/thirdLogout/${type}/${channel}`)
